package lab02.test20;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        /*用户从键盘输入一行含有数字和字符的字符串*/
        System.out.println("输入一行含有数字和字符的字符串：");
        String string = sc.nextLine();

        /*输出字符串中的全部数字字符*/
        for (int i = 0; i < string.length(); i++) {
            if (string.charAt(i) >= '0' && string.charAt(i) <= '9') {
                System.out.print(string.charAt(i));
            }
        }
    }
}
